package pers.huangyuhui.sms.service.impl;

import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Service;
import pers.huangyuhui.sms.mapper.ClassMapper;
import pers.huangyuhui.sms.model.ClazzInfo;
import pers.huangyuhui.sms.service.ClassService;
import pers.huangyuhui.sms.util.MyBatisUtil;

import java.util.List;
import java.util.Map;

@Service(value = "classService")
public class ClassServiceImpl implements ClassService {

    private SqlSession sqlSession = MyBatisUtil.getSqlSession();

    private ClassMapper classMapper = sqlSession.getMapper(ClassMapper.class);

    @Override
    public List<ClazzInfo> getClassList(Map<String, Object> map) {
        return classMapper.getClassList(map);
    }

    @Override
    public int getClassListNum(ClazzInfo clazzInfo) {
        return classMapper.getClassListNum(clazzInfo);
    }

    @Override
    public boolean addClass(ClazzInfo clazzInfo) {
        return classMapper.addClass(clazzInfo);
    }

    @Override
    public boolean deleteClass(Integer classId) {
        return classMapper.deleteClass(classId);
    }

    @Override
    public boolean editClassInfo(ClazzInfo clazzInfo) {
        return classMapper.editClassInfo(clazzInfo);
    }
}
